package com.ruoyi.alipay.mapper;


import com.ruoyi.alipay.domain.PaymentSettlement;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface PaymentSettlementMapper {
    /**
     * 查询支付列表
     * @param payment 查询条件
     * @return 支付列表
     */
    List<PaymentSettlement> selectPaymentList(PaymentSettlement payment);
    
    /**
     * 查询支付详情
     * @param id 支付ID
     * @return 支付详情
     */
    PaymentSettlement selectPaymentById(Long id);
    /**
     * 插入支付订单
     * @param payment
     * @return
     */
    int insert(PaymentSettlement payment);
    /**
     * 根据outTradeNo查询支付订单
     * @param outTradeNo
     * @return
     */
    PaymentSettlement findByOutTradeNo(String outTradeNo);
    /**
     * 根据outTradeNo更新支付订单
     * @param payment
     * @return
     */
    int updateByOutTradeNo(PaymentSettlement payment);

    /**
     * 根据用户id和商品名称查询支付订单
     * @param userId
     * @param productName
     * @return
     */
    PaymentSettlement findByUserIdAndProductName(Integer userId, String productName);

    /**
     * 根据用户id查询支付订单
     * @param userId
     * @return
     */
    List<PaymentSettlement> findByUserId(Integer userId);
}
